#include <cstdio>
#include <algorithm>
using namespace std;
const int maxn = 1e5 + 5;
int n, a[maxn];
int cnt, tmp, ans;
int main() {
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", a + i);
    sort(a + 1, a + n + 1);
    for (int i = 1; i <= n; i++) {
        if (cnt) ans++, cnt--;
        if (a[i] != a[i + 1]) cnt += tmp + 1, tmp = 0;
        else tmp++;
    }
    printf("%d\n", n - ans);
    fclose(stdin);
    fclose(stdout);
    return 0;
}